<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!doctype html>
<html lang="zh-CN">
<head>
<style type="text/css">
.id {
	width: 500px;
	height: 30px;
	font-size: 20px;
}

.btn {
	height: 35px;
	font-size: 20px;
}

td {
	padding: 5px;
}

.row_num, .balance {
	text-align: right;
}

.error {
	color: red;
}

.see {
	color: gray;
	font-size: 10px;
}

#balanceResult {
	font-size: 20px;
	color: green;
}

#lastGroupCountTbody td {
	text-align: right;
}
.del{
	text-decoration: line-through;
	color: red;
}
.count{
color: gray;
display: inline-block;
background-color: #ccc;

}
</style>
<title>资产负债表</title>
<body>
	<div id="div1"></div>
	<h4>近60天资金成本情况</h4>
	<div>
		<table border="1">
			<thead>
				<tr>
					<th>日期</th>
					<th>银收</th>
					<th>银支</th>
					<th>银存</th>
					<th>应付费用</th>
					<th>资金成本</th>
					<th>回款本金</th>
					<th>已付费用</th>
				</tr>
			</thead>
			<tbody id="lastGroupCountTbody">
				<tr style="display: none">
					<td class="date">日期</td>
					<td ><span class="bank_dr"></span></td>
					<td class="bank_cr"></td>
					<td class="bank_cash"></td>
					<td ><span class="COST_NEEDPAY"></span> <span class="COST_NEEDPAY_COUNT count" title="行数"></span></td>
					<td class="COST_percent"></td>
					<td ><span class="PAYMENT_PRINCIPAL"></span> <span class="PAYMENT_PRINCIPAL_COUNT count"></span></td>
					<td class="COST_PAYED"></td>
				</tr>
			</tbody>
		</table>
		<div>查看明细，<a href="account_balance_sheet.jsp">请点这里</a></div>
	</div>

	<h4>资产负债</h4>
	<table border="1">
		<thead>
			<tr>
				<th></th>
				<th>科目名称</th>
				<th>科目代码</th>
				<th>笔数</th>
				<th>余额</th>
			</tr>
		</thead>
		<tbody id="tbody">
			<tr>
				<td class="index"></td>
				<td class="subject_name"></td>
				<td class="subject_code"></td>
				<td class="row_num"></td>
				<td class="balance"></td>
			</tr>
		</tbody>
	</table>
	<h4>各种公式</h4>
	<div>
		平衡公式：活期负债 + 定期负债 = 银行存款 + (应付费用 - 已付费用) <span id="balanceResult"
			title="该值为0时说明公式平衡">计算中...</span>
	</div>
	<div>
		成本公式一：1天资金成本 = 当天新产生应付费用 / 当天银行存款 <span class="see">适合0点采样</span>
	</div>
	<h4>调整</h4>
	<div>
		<textarea id="balanceString" style="width: 300px; height: 50px;"
			placeholder="DEBT_D:100.99,BANK_CASH:1000.00"></textarea>
	</div>
	<div>
		<input id="remark" placeholder="调整原因..." />
	</div>
	<div style="color: red;">调整的值会进行平衡计算，公式不明白的请问技术部。</div>
	<button id="btnDoImproveBalance">确认调整</button>

	<h4>计账规则</h4>
	<div>
		<table border="1">
			<thead>
				<tr>
					<th>场景</th>
					<th>计账</th>
					<th>状态</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>用户银行卡买入活期</td>
					<td>+银行存款，+活期负债</td>
					<td>√</td>
				</tr>
				<tr>
					<td>用户银行卡买入定期</td>
					<td>+银行存款，+定期负债，+应付费用(现金券)</td>
					<td>√</td>
				</tr>
				<tr>
					<td>用户活转定(复利情况)</td>
					<td>+定期负债，-活期负债，+应付费用(现金券)</td>
					<td>√</td>
				</tr>
				<tr>
					<td>用户活转定(非复利情况)</td>
					<td>+定期负债，-活期负债，+应付费用(现金券)</td>
					<td>√</td>
				</tr>
				<tr>
					<td>每天0点，复利活期算息</td>
					<td>+应付费用(利息)，+活期负债</td>
					<td>√</td>
				</tr>
				<tr>
					<td>每天0点，非复利活期算息</td>
					<td>+应付费用(利息)，+活期负债</td>
					<td>√ </td>
				</tr>
				<tr>
					<td>每天0点，定期算息</td>
					<td>+应付费用(利息)，+定期负债</td>
					<td>√</td>
				</tr>
				<tr>
					<td>每天9点45，定转活</td>
					<td>-定期负债，+活期负债</td>
					<td>√</td>
				</tr>
				<tr >
					<td>打款-用户提现(复利情况)</td>
					<td>-活期负债，-银行存款，＋已付费用(利息)，＋回款本金</td>
					<td>√</td>
				</tr>
				<tr>
					<td>打款-用户提现(非复利情况)</td>
					<td>-活期负债，-银行存款，＋已付费用(利息)，＋回款本金</td>
					<td>√</td>
				</tr>
				<tr>
					<td>打款-定期到期回款到银行卡</td>
					<td>-定期负债，-银行存款，＋已付费用(利息)，＋回款本金</td>
					<td>√</td>
				</tr> 
			</tbody>
		</table>
	</div>


	<script src="../static/jquery-1.11.0.js"></script>
	<script src="account_balance.js"></script>

</body>
</html>
